package com.szp.spCloud.user;

import com.szp.spCloud.common.service.MailService;
import com.szp.spCloud.common.service.TokenValidateService;
import com.szp.spCloud.user.controller.UserController;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@EnableDiscoveryClient
@EntityScan(basePackages={"com.szp.spCloud.common.pojo"})
@ComponentScan(basePackages = {"com.szp.spCloud.common.service.*","com.szp.spCloud.user"})
public class UserServiceApplication implements BeanFactoryAware {
    public static void main(String[] args) {
        SpringApplication.run(UserServiceApplication.class, args);
    }

    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        TokenValidateService tokenValidateService = beanFactory.getBean(TokenValidateService.class);
        System.out.println(tokenValidateService);

        UserController userController = beanFactory.getBean(UserController.class);
        System.out.println(userController);
    }
}
